import request from '@/utils/request'

// 用户列表（分页）
export function pageList(query) {
  return request({
    url: '/system/interlace/member/pageList',
    method: 'get',
    loading: true,
    params: query
  })
}

// 用户详情
export function getDetail(id) {
  return request({
    url: '/system/interlace/member/detail/' + id,
    method: 'get',
    loading: true
  })
}

// 禁用/解除禁用
export function prohibit(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/system/interlace/member/prohibit',
    method: 'put',
    loading: true,
    data: data
  })
}

// 用户列表（分页）
export function vipMemberPageList(query) {
  return request({
    url: '/system/interlace/member/vip/pageList',
    method: 'get',
    loading: true,
    params: query
  })
}

// 系统设置会员
export function sysSetVip(id, becomeVipWay) {
  const data = {
    id,
    becomeVipWay
  }
  return request({
    url: '/system/interlace/member/sysSetVip',
    method: 'put',
    loading: true,
    data: data
  })
}

// 会员申请列表（分页）
export function vipApplyPageList(query) {
  return request({
    url: '/system/interlace/member/vipApply/pageList',
    method: 'get',
    loading: true,
    params: query
  })
}

// 系统设置会员
export function auditVipApply(id, auditStatus,failRemark) {
  const data = {
    id,
    auditStatus,
    failRemark
  }
  return request({
    url: '/system/interlace/member/vipApply/audit',
    method: 'put',
    loading: true,
    data: data
  })
}

// 用户列表（分页）
export function memberList(query) {
  return request({
    url: '/system/interlace/member/list',
    method: 'get',
    loading: true,
    params: query
  })
}

export function refreshMoney(id) {
  return request({
    url: '/system/interlace/member/refreshMoney/' + id,
    method: 'get',
    loading: true
  })
}
